package com.ruoyi.web.nywjzsj.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.web.nywjzsj.domain.ElectricBoxEnergy;
import com.ruoyi.web.nywjzsj.mapper.ElectricBoxEnergyMapper;
import com.ruoyi.web.nywjzsj.service.IElectricBoxEnergyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 电箱数据计量Service业务层处理
 *
 * @author ruoyi
 * @date 2025-09-19
 */
@Service
public class ElectricBoxEnergyServiceImpl implements IElectricBoxEnergyService
{
    @Autowired
    private ElectricBoxEnergyMapper electricBoxEnergyMapper;

    /**
     * 查询电箱数据计量
     *
     * @param id 电箱数据计量主键
     * @return 电箱数据计量
     */
    @Override
    public ElectricBoxEnergy selectElectricBoxEnergyById(Long id)
    {
        return electricBoxEnergyMapper.selectElectricBoxEnergyById(id);
    }

    /**
     * 查询电箱数据计量列表
     *
     * @param electricBoxEnergy 电箱数据计量
     * @return 电箱数据计量
     */
    @Override
    public List<ElectricBoxEnergy> selectElectricBoxEnergyList(ElectricBoxEnergy electricBoxEnergy)
    {
        return electricBoxEnergyMapper.selectElectricBoxEnergyList(electricBoxEnergy);
    }

    /**
     * 新增电箱数据计量
     *
     * @param electricBoxEnergy 电箱数据计量
     * @return 结果
     */
    @Override
    public int insertElectricBoxEnergy(ElectricBoxEnergy electricBoxEnergy)
    {
        electricBoxEnergy.setCreateTime(DateUtils.getNowDate());
        return electricBoxEnergyMapper.insertElectricBoxEnergy(electricBoxEnergy);
    }

    /**
     * 修改电箱数据计量
     *
     * @param electricBoxEnergy 电箱数据计量
     * @return 结果
     */
    @Override
    public int updateElectricBoxEnergy(ElectricBoxEnergy electricBoxEnergy)
    {
        electricBoxEnergy.setUpdateTime(DateUtils.getNowDate());
        return electricBoxEnergyMapper.updateElectricBoxEnergy(electricBoxEnergy);
    }

    /**
     * 批量删除电箱数据计量
     *
     * @param ids 需要删除的电箱数据计量主键
     * @return 结果
     */
    @Override
    public int deleteElectricBoxEnergyByIds(Long[] ids)
    {
        return electricBoxEnergyMapper.deleteElectricBoxEnergyByIds(ids);
    }

    /**
     * 删除电箱数据计量信息
     *
     * @param id 电箱数据计量主键
     * @return 结果
     */
    @Override
    public int deleteElectricBoxEnergyById(Long id)
    {
        return electricBoxEnergyMapper.deleteElectricBoxEnergyById(id);
    }
}
